package com.ziq.zcamp

import com.amap.api.maps.MapsInitializer
import com.amap.api.services.core.ServiceSettings
import com.qweather.sdk.view.HeConfig
import com.ziq.base.base.BaseApplication
import com.ziq.zcamp.manager.GlobalContextManager
import com.ziq.zcamp.manager.PrivacyManager
import com.ziq.zcamp.manager.UserManager
import dagger.hilt.android.HiltAndroidApp

@HiltAndroidApp
class ZCampApplication : BaseApplication() {
    override fun onCreate() {
        super.onCreate()
        GlobalContextManager.init(this)
        if(PrivacyManager.isPrivacyHasShowed()){
            MapsInitializer.updatePrivacyShow(GlobalContextManager.appContext,true,true)
            ServiceSettings.updatePrivacyShow(GlobalContextManager.appContext,true,true);
            if(PrivacyManager.isAgreedPrivacy()){
                MapsInitializer.updatePrivacyAgree(GlobalContextManager.appContext, true)
                ServiceSettings.updatePrivacyAgree(GlobalContextManager.appContext,true);
            }
        }

        UserManager.instance.initCacheData()
        //weather
        HeConfig.init("HE2309191647001834","302f1dc5d8e14cb8a4174c393600aef6")
        //切换至免费订阅
        HeConfig.switchToDevService()

    }

}